"""Common code not specific to any one module. assert-type functions, logging functions, 
list-manipulation and new data structures would all go here."""

def assure(obj, type):
    assert isinstance(obj, type)
    return obj

def ensure(args, type):
    if isinstance(args, type):
        return args
    else:
        return type(args)

class UsageError(Exception):
    def __init__(self, msg):
        Exception.__init__(self, msg)
        
